package com.xbongbong.saas.service;

import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.pojo.dto.FormDataRepeatDTO;
import com.xbongbong.paas.pojo.vo.CheckRepeatVO;
import com.xbongbong.paas.pojo.vo.FormDataRepeatVO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.recheck.pojo.dto.RecheckingRuleGetDTO;
import com.xbongbong.pro.recheck.pojo.dto.RecheckingRuleSaveDTO;
import com.xbongbong.pro.recheck.pojo.vo.RecheckingAttrListVO;
import com.xbongbong.pro.recheck.pojo.vo.RecheckingFieldListVO;
import com.xbongbong.pro.recheck.pojo.vo.RecheckingRuleListVO;

import java.util.List;
import java.util.Map;

/**
 * @description 重复规则业务逻辑层
 * @author yanglei
 * @date 2022/11/8 19:06
 */
public interface RecheckingRuleService {
    /**
     * @description 重复规则保存
     * @author yanglei
     * @date 2022/11/8 19:09
     * @param saveDTO
     * @return Integer
     */
    Integer save(RecheckingRuleSaveDTO saveDTO) throws XbbException;

    /**
     * @description 获取重复规则列表
     * @author yanglei
     * @date 2022/11/8 19:34
     * @param recheckingRuleGetDTO
     * @return List<RecheckingRuleListVO>
     */
    RecheckingRuleListVO getList(RecheckingRuleGetDTO recheckingRuleGetDTO) throws XbbException;

    /**
     * @description 获取相关业务的查重可选字段和表单模板列表
     * @author yanglei
     * @date 2022/11/10 10:47
     * @param recheckingRuleGetDTO
     * @return RecheckingFieldListVO
     */
    RecheckingFieldListVO getRecheckAttrAndFormList(RecheckingRuleGetDTO recheckingRuleGetDTO) throws XbbException;

    /**
     * @description 获取指定表单的重复规则可选字段
     * @author yanglei
     * @date 2022/11/10 18:38
     *
     */
    RecheckingAttrListVO getRecheckAttrByForm(RecheckingRuleGetDTO recheckingRuleGetDTO) throws XbbException;

    /** 
     * @description  保存表单解释时，将勾选新建不允许重复的字段，封装成规则到tb_rechecking_rule
     * @author yanglei
     * @date 2022/11/14 19:04
     * @param explainList
     * @param formId
     * @param businessType
     */
    void syncExplainsToRecheckRule(String corpid,List<FieldAttrEntity> explainList,Long formId,Integer businessType) throws XbbException;

    /**
     * @description 新建编辑页，字段单执行重复规则入口
     * @author yanglei
     * @date 2022/11/22 10:59
     * @param formDataRepeatDTO
     * @return CheckRepeatVO
     */
    //CheckRepeatVO recheckAddEditExeute(FormDataRepeatDTO formDataRepeatDTO)  throws XbbException;
    //
    ///**
    // * @description 导入判重
    // * @author yanglei
    // * @date 2022/12/2 16:15
    // * @param formDataRepeatDTO
    // * @return CheckRepeatVO
    // */
    //FormDataRepeatVO recheckImportExeute(FormDataRepeatDTO formDataRepeatDTO, Map<String, Object> repeatValueMap)  throws XbbException;


}
